
#ifndef __FORMATTER_H__
#define __FORMATTER_H__

#include <ostream>
#include <LengthUnit.h>
#include <Amount.h>

class Formatter
{
public:
	Formatter(const Amount & amount, std::ostream& out);

	void formatStringInAllUnit();
	void formatStringInBaseUnit();
        void operator()(const Unit* unit);
	
private:
	void formatZeroString();
	void formatNonZeroStringInAllUnit();
	void formatNonZeroStringInBaseUnit();

	const Amount & amount_m;
       std::ostream& out_m;
	bool firstUnitFound_m;
};

#endif

